package com.hk.magic;

public class OddMagicSquare {
	private int[][] magicSquare;

	public OddMagicSquare() {
		magicSquare = new int [3][3];
	}
	public OddMagicSquare(int n) {
		magicSquare = new int [n][n]; 
	}
	public int[][] getMagicSquare() {
		return magicSquare;
	}
	
	public void oddMake(){
		int n = magicSquare.length;

		int x=0;
		int y = n/2;
		magicSquare[x][y] =1;
		
		for (int i = 2; i < n*n; i++) {
			int tempX =x;
			int tempY =y;
		if (x-1<0) {
			x=n-1;
		}else{
			x--;
		}if (y-1<0) {
			y=n-1;
		}else{
			y--;
		}
		if(magicSquare[x][y]!=0){
			x=tempX-1;
			y=tempY;
		}
			
		}
	}
	
	
	

}
